package server.business.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import server.business.mapper.ReturnBloodInformationMapper;
import server.business.pojo.ReturnBloodInformation;
import server.business.service.ReturnBloodInformationService;

import java.util.List;

@Service
public class ReturnBloodInformationServiceImpl extends ServiceImpl<ReturnBloodInformationMapper, ReturnBloodInformation>
        implements ReturnBloodInformationService {

    @Autowired
    ReturnBloodInformationMapper returnBloodInformationMapper;


    @Override
    public void add(List<ReturnBloodInformation> list) {
        for(ReturnBloodInformation returnBloodInformation:list){
            returnBloodInformationMapper.insert(returnBloodInformation);
        }
    }

    @Override
    public List<ReturnBloodInformation> getAll(String id) {
        LambdaQueryWrapper<ReturnBloodInformation> queryWrapper = new LambdaQueryWrapper<ReturnBloodInformation>();
        queryWrapper.eq(ReturnBloodInformation::getApplyId,id);
        List<ReturnBloodInformation> bloodInformations = returnBloodInformationMapper.selectList(queryWrapper);
        return bloodInformations;
    }
}
